api_submission_tests.html

Report generated on 12-Mar-2025 at 14:38:40 by pytest-html v3.1.1

Summary

182 tests ran in 929.15 seconds.

80 passed, 2 skipped, 102 failed, 0 errors, 0 expected failures, 0 unexpected passes, 0 rerun

Results

Result Test Duration Links
Failed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@mozilla.org] 6.95
base_url = 'https://addons.allizom.org', session_auth = 'jn6ex21smu7pmfq0r7euvd6u98a1q4kv', guid = 'reserved_guid@mozilla.org'

@pytest.mark.parametrize(
"guid",
[
"reserved_guid@mozilla.com",
"reserved_guid@mozilla.org",
"reserved_guid@pioneer.mozilla.org",
"reserved_guid@search.mozilla.org",
"reserved_guid@shield.mozilla.com",
"reserved_guid@shield.mozilla.org",
"reserved_guid@mozillaonline.com",
"reserved_guid@mozillafoundation.org",
"reserved_guid@rally.mozilla.org",
"reserved_guid@temporary-addon",
"reserved_guid@mozac.org",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_submit_addon_with_reserved_guid(base_url, session_auth, guid):
"""Upload an addon that has a reserved guid suffix, unavailable for regular users"""
manifest = {
**payloads.minimal_manifest,
"name": "Reserved guid",
"browser_specific_settings": {"gecko": {"id": guid}},
}
api_helpers.make_addon(manifest)
with open("sample-addons/make-addon.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "listed"},
)
upload.raise_for_status()
# sleep to allow the upload request to be processed
time.sleep(5)
resp = upload.json()
print(resp)
uuid = resp["uuid"]
payload = payloads.listed_addon_minimal(uuid)
create_addon = requests.post(
url=f"{base_url}{_addon_create}",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
assert (
create_addon.status_code == 400
), f'For guid "{guid}": response status was {create_addon.status_code}, {create_addon.text}'
> assert (
"You cannot submit an add-on using an ID ending with this suffix"
in create_addon.text
), f"Actual response was {create_addon.text}"
E AssertionError: Actual response was {"version":{"upload":["Upload is not valid."]}}
E assert 'You cannot submit an add-on using an ID ending with this suffix' in '{"version":{"upload":["Upload is not valid."]}}'
E + where '{"version":{"upload":["Upload is not valid."]}}' = <Response [400]>.text

tests/api/test_addon_uploads.py:416: AssertionError
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@mozilla.org'}}} {'uuid': 'e5e3672001544a3e8f073a550e7c74e9', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/e5e3672001544a3e8f073a550e7c74e9/', 'valid': False, 'validation': None, 'version': '1.0'}
Failed tests/api/test_addon_uploads.py::test_upload_theme_with_wrong_license 6.79
base_url = 'https://addons.allizom.org', session_auth = 'jn6ex21smu7pmfq0r7euvd6u98a1q4kv'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_upload_theme_with_wrong_license(base_url, session_auth):
"""Try to upload a theme while using a license that is specific for extensions"""
with open("sample-addons/theme.xpi", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "listed"},
)
time.sleep(5)
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
# set a license slug that is allowed only for extension submissions
ext_license = "MPL-2.0"
payload = {
**payloads.theme_details(uuid, ext_license),
"slug": f"theme-{reusables.get_random_string(10)}",
}
create_addon = requests.post(
url=f"{base_url}{_addon_create}",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
assert (
create_addon.status_code == 400
), f"Actual response: {create_addon.status_code}, {create_addon.text}"
> assert (
"Wrong add-on type for this license." in create_addon.text
), f"Actual response was {create_addon.text}"
E AssertionError: Actual response was {"version":{"upload":["Upload is not valid."]}}
E assert 'Wrong add-on type for this license.' in '{"version":{"upload":["Upload is not valid."]}}'
E + where '{"version":{"upload":["Upload is not valid."]}}' = <Response [400]>.text

tests/api/test_addon_uploads.py:1095: AssertionError
Failed tests/api/test_addon_uploads.py::test_upload_addon_with_reserved_guid_authorized_account 6.84
base_url = 'https://addons.allizom.org', session_auth = 'acwej1luyf5b4lsu7tjq91893hzd2fpk'

@pytest.mark.serial
@pytest.mark.create_session("staff_user")
def test_upload_addon_with_reserved_guid_authorized_account(base_url, session_auth):
"""Upload an addon with a reserved guid using an account that holds the right permissions"""
# create a restricted GUID
guid = f"{reusables.get_random_string(10)}@mozilla.org"
manifest = {
**payloads.minimal_manifest,
"name": "Reserved guid",
"browser_specific_settings": {"gecko": {"id": guid}},
}
api_helpers.make_addon(manifest)
with open("sample-addons/make-addon.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "unlisted"},
)
time.sleep(5)
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
payload = {**payloads.listed_addon_minimal(uuid)}
create_addon = requests.post(
url=f"{base_url}{_addon_create}",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
create_addon.status_code == 201
), f"Actual response: {create_addon.status_code}, {create_addon.text}"
E AssertionError: Actual response: 400, {"version":{"upload":["Upload is not valid."]}}
E assert 400 == 201
E + where 400 = <Response [400]>.status_code

tests/api/test_addon_uploads.py:1301: AssertionError
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'razlpjcdqx@mozilla.org'}}}
Failed tests/api/test_api_addons_edit.py::test_upload_listed_extension_tc_id_c4369[Desktop] 65.64
base_url = 'https://addons.allizom.org', selenium = <selenium.webdriver.firefox.webdriver.WebDriver (session="eab604b8-2c4f-496d-bae5-718a06318685")>

@pytest.mark.serial
@pytest.mark.login("api_user")
@pytest.mark.fail
def test_upload_listed_extension_tc_id_c4369(base_url, selenium):
session_cookie = selenium.get_cookie("sessionid")
with open("sample-addons/listed-addon-api.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f'Session {session_cookie["value"]}'},
files={"upload": file},
data={"channel": "listed"},
)
print(f'Session Token: {session_cookie["value"]}')
print(f"Uploading to: {base_url}{_upload}")
resp = upload.json()
print(json.dumps(resp, indent=2))
upload.raise_for_status()
assert "listed" in resp["channel"]
# get the addon uuid generated after upload
uuid = resp["uuid"]
payload = payloads.listed_addon_details(uuid)
# sleep to allow the first request to be processed
time.sleep(10)
create_addon = requests.post(
url=f"{base_url}{_addon_create}",
headers={
"Authorization": f'Session {session_cookie["value"]}',
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(create_addon.json())
> create_addon.raise_for_status()

tests/api/test_api_addons_edit.py:60:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [400]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://addons.allizom.org/api/v5/addons/addon/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
-----------------------------Captured stdout setup------------------------------
The "click continue button" event occurred.
------------------------------Captured stdout call------------------------------
Session Token: mbzod2nbhdk4afkhmxtwqsrcc6dju2wo Uploading to: https://addons.allizom.org/api/v5/addons/upload/ { "uuid": "78565a1fc57942e4b61851d8067ea5ae", "channel": "listed", "processed": false, "submitted": false, "url": "https://addons.allizom.org/api/v5/addons/upload/78565a1fc57942e4b61851d8067ea5ae/", "valid": false, "validation": null, "version": "1.0" } {'slug': ['addon with this slug already exists.']}
Failed tests/api/test_api_addons_edit.py::test_edit_listed_addon_details 1.57
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
@pytest.mark.fail
def test_edit_listed_addon_details(base_url, session_auth):
payload = payloads.edit_addon_details
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}my_sluggish_slug_api/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> edit_addon.raise_for_status()

tests/api/test_api_addons_edit.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [400]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://addons.allizom.org/api/v5/addons/addon/my_sluggish_slug_api/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_addons_edit.py::test_edit_extension_duplicate_slug 0.84
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_duplicate_slug(base_url, session_auth, variables):
"""Use a slug that already belongs to another addon"""
addon = payloads.edit_addon_details["slug"]
payload = {
**payloads.edit_addon_details,
"slug": variables["approved_addon_with_sources"],
}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:319: AssertionError
Failed tests/api/test_api_addons_edit.py::test_edit_extension_invalid_name 0.84
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_invalid_name(base_url, session_auth):
"""Addon names are required to have at least one letter or number character to be valid"""
addon = payloads.edit_addon_details["slug"]
invalid_names = ["", ".", "****", None]
for item in invalid_names:
# crete a new dictionary from the original payload, with invalid name values
payload = {**payloads.edit_addon_details, "name": {"en-US": item}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For name "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:347: AssertionError
------------------------------Captured stdout call------------------------------
For name "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_with_trademark_in_name[A Name with Firefox] 0.83
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', trademark_name = 'A Name with Firefox'

@pytest.mark.parametrize(
"trademark_name",
[
"A Name with Firefox",
"A Name with Mozilla",
"A Name with Mozilla Firefox",
"Name has FireFox",
"Name has MOZILLA",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_with_trademark_in_name(base_url, session_auth, trademark_name):
"""Verifies that addon names can't be edited to include a Mozilla or Firefox trademark"""
addon = payloads.edit_addon_details["slug"]
# crete a new dictionary from the original payload, with variable name values
name = {**payloads.edit_addon_details, "name": {"en-US": trademark_name}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(name),
)
print(
f'For name "{trademark_name}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:395: AssertionError
------------------------------Captured stdout call------------------------------
For name "A Name with Firefox": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_with_trademark_in_name[A Name with Mozilla] 0.96
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', trademark_name = 'A Name with Mozilla'

@pytest.mark.parametrize(
"trademark_name",
[
"A Name with Firefox",
"A Name with Mozilla",
"A Name with Mozilla Firefox",
"Name has FireFox",
"Name has MOZILLA",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_with_trademark_in_name(base_url, session_auth, trademark_name):
"""Verifies that addon names can't be edited to include a Mozilla or Firefox trademark"""
addon = payloads.edit_addon_details["slug"]
# crete a new dictionary from the original payload, with variable name values
name = {**payloads.edit_addon_details, "name": {"en-US": trademark_name}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(name),
)
print(
f'For name "{trademark_name}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:395: AssertionError
------------------------------Captured stdout call------------------------------
For name "A Name with Mozilla": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_with_trademark_in_name[A Name with Mozilla Firefox] 0.90
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', trademark_name = 'A Name with Mozilla Firefox'

@pytest.mark.parametrize(
"trademark_name",
[
"A Name with Firefox",
"A Name with Mozilla",
"A Name with Mozilla Firefox",
"Name has FireFox",
"Name has MOZILLA",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_with_trademark_in_name(base_url, session_auth, trademark_name):
"""Verifies that addon names can't be edited to include a Mozilla or Firefox trademark"""
addon = payloads.edit_addon_details["slug"]
# crete a new dictionary from the original payload, with variable name values
name = {**payloads.edit_addon_details, "name": {"en-US": trademark_name}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(name),
)
print(
f'For name "{trademark_name}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:395: AssertionError
------------------------------Captured stdout call------------------------------
For name "A Name with Mozilla Firefox": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_with_trademark_in_name[Name has FireFox] 1.00
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', trademark_name = 'Name has FireFox'

@pytest.mark.parametrize(
"trademark_name",
[
"A Name with Firefox",
"A Name with Mozilla",
"A Name with Mozilla Firefox",
"Name has FireFox",
"Name has MOZILLA",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_with_trademark_in_name(base_url, session_auth, trademark_name):
"""Verifies that addon names can't be edited to include a Mozilla or Firefox trademark"""
addon = payloads.edit_addon_details["slug"]
# crete a new dictionary from the original payload, with variable name values
name = {**payloads.edit_addon_details, "name": {"en-US": trademark_name}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(name),
)
print(
f'For name "{trademark_name}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:395: AssertionError
------------------------------Captured stdout call------------------------------
For name "Name has FireFox": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_with_trademark_in_name[Name has MOZILLA] 0.87
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', trademark_name = 'Name has MOZILLA'

@pytest.mark.parametrize(
"trademark_name",
[
"A Name with Firefox",
"A Name with Mozilla",
"A Name with Mozilla Firefox",
"Name has FireFox",
"Name has MOZILLA",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_with_trademark_in_name(base_url, session_auth, trademark_name):
"""Verifies that addon names can't be edited to include a Mozilla or Firefox trademark"""
addon = payloads.edit_addon_details["slug"]
# crete a new dictionary from the original payload, with variable name values
name = {**payloads.edit_addon_details, "name": {"en-US": trademark_name}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(name),
)
print(
f'For name "{trademark_name}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:395: AssertionError
------------------------------Captured stdout call------------------------------
For name "Name has MOZILLA": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_invalid_summary 0.87
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_invalid_summary(base_url, session_auth):
"""Addon summaries need to be in string format and below 250 characters"""
addon = payloads.edit_addon_details["slug"]
over_250_summary = reusables.get_random_string(251)
summaries = ["", over_250_summary, None]
# crete a new dictionary from the original payload, with invalid summary values
for item in summaries:
payload = {**payloads.edit_addon_details, "summary": {"en-US": item}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For summary "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:426: AssertionError
------------------------------Captured stdout call------------------------------
For summary "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_invalid_homepage 0.86
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_invalid_homepage(base_url, session_auth):
"""Try to add some invalid and unaccepted homepage urls for an addon"""
addon = payloads.edit_addon_details["slug"]
invalid_homepage = [
"",
".",
"abc123",
"example.com",
"http://not-valid",
"www.some-url.org",
base_url,
]
for item in invalid_homepage:
# crete a new dictionary from the original payload, with variable homepage values
homepage = {**payloads.edit_addon_details, "homepage": {"en-US": item}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(homepage),
)
print(
f'For homepage "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:473: AssertionError
------------------------------Captured stdout call------------------------------
For homepage "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_invalid_support_email 0.95
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_invalid_support_email(base_url, session_auth):
"""Try to add some invalid and unaccepted emails for an addon"""
addon = payloads.edit_addon_details["slug"]
invalid_email = ["", ".", "abc123", "mail.com", "abc@defg", 123, None]
for item in invalid_email:
# crete a new dictionary from the original payload, with variable email values
email = {**payloads.edit_addon_details, "support_email": {"en-US": item}}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(email),
)
print(
f'For email "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:513: AssertionError
------------------------------Captured stdout call------------------------------
For email "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_invalid_experimental_and_payment 0.90
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_invalid_experimental_and_payment(base_url, session_auth):
"""Try to set the 'experimental' and 'requires_payment' fields to other values than boolean"""
addon = payloads.edit_addon_details["slug"]
# 'is_experimental' and 'requires_payment' can only be True or False
invalid_values = ["", "abc123", None, 123]
for item in invalid_values:
# crete a new dictionary from the original payload, with variable values
payload = {
**payloads.edit_addon_details,
"is_experimental": item,
"requires_payment": item,
}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For email "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:557: AssertionError
------------------------------Captured stdout call------------------------------
For email "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_valid_contribute_domains 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_valid_contribute_domains(base_url, session_auth):
"""Add a valid contributions url to an addon; requests should be successful"""
addon = payloads.edit_addon_details["slug"]
valid_domains = [
"https://buymeacoffee.com",
"https://donate.mozilla.org",
"https://flattr.com",
"https://github.com/sponsors/",
"https://ko-fi.com",
"https://liberapay.com",
"https://www.micropayment.de",
"https://opencollective.com",
"https://www.patreon.com",
"https://www.paypal.com",
"https://paypal.me",
]
for item in valid_domains:
# crete a new dictionary from the original payload, with variable domain values
payload = {**payloads.edit_addon_details, "contributions_url": item}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For domain "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 200
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:603: AssertionError
------------------------------Captured stdout call------------------------------
For domain "https://buymeacoffee.com": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_invalid_contribute_domains 0.94
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_invalid_contribute_domains(base_url, session_auth, variables):
"""Set an invalid or an unaccepted value as the addon's contribution url;
accepted domains are predefined and must all start with 'https'"""
addon = payloads.edit_addon_details["slug"]
invalid_domains = [
"",
123,
"abc123",
"https://invalid.com",
"https://www.notbuymeacoffee.com",
"http://donate.mozilla.org",
"https://patreon.com",
"https://www.paypal.me",
]
for item in invalid_domains:
# crete a new dictionary from the original payload, with variable domain values
payload = {**payloads.edit_addon_details, "contributions_url": item}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For domain "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:638: AssertionError
------------------------------Captured stdout call------------------------------
For domain "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_invalid_addon_tags 0.86
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_invalid_addon_tags(base_url, session_auth):
"""Try to set some invalid or unaccepted tags to an addon; valid tags are predefined"""
addon = payloads.edit_addon_details["slug"]
# set some invalid or combinations of invalid tags; for example,
# a combination of a valid and an invalid tag should not be accepted
invalid_tags = [["", "abc123"], None, [123, "search"], True]
for item in invalid_tags:
# crete a new dictionary from the original payload, with variable values
payload = {**payloads.edit_addon_details, "tags": item}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For tags "{item}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:686: AssertionError
------------------------------Captured stdout call------------------------------
For tags "['', 'abc123']": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_valid_icon[PNG icon] 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', icon = 'img/profile_picture.png'

@pytest.mark.parametrize(
"icon",
[
"img/profile_picture.png",
"img/addon_icon.jpg",
],
ids=[
"PNG icon",
"JPG icon",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_valid_icon(base_url, session_auth, icon):
"""Upload a custom icon for an addon; JPG and PNG are the only accepted formats"""
addon = payloads.edit_addon_details["slug"]
with open(icon, "rb") as img:
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
files={"icon": img},
)
print(
f'For icon "{icon}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 200
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:729: AssertionError
------------------------------Captured stdout call------------------------------
For icon "img/profile_picture.png": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_valid_icon[JPG icon] 1.04
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', icon = 'img/addon_icon.jpg'

@pytest.mark.parametrize(
"icon",
[
"img/profile_picture.png",
"img/addon_icon.jpg",
],
ids=[
"PNG icon",
"JPG icon",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_valid_icon(base_url, session_auth, icon):
"""Upload a custom icon for an addon; JPG and PNG are the only accepted formats"""
addon = payloads.edit_addon_details["slug"]
with open(icon, "rb") as img:
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
files={"icon": img},
)
print(
f'For icon "{icon}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 200
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:729: AssertionError
------------------------------Captured stdout call------------------------------
For icon "img/addon_icon.jpg": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_icons[BMP icon] 0.91
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 0, icon = 'img/bmp_icon.bmp'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, icon",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
"img/not_square.png",
]
),
ids=[
"BMP icon",
"GIF static icon",
"PNG animated icon",
"Non image file with a .png extension",
"Icon not square",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_icons(
base_url, session_auth, count, icon, variables
):
"""Verify that requests fail if icons do not meet these acceptance criteria:
PNG or JPG, square images, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(icon, "rb") as img:
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
files={"icon": img},
)
print(
f'For icon "{icon}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:777: AssertionError
------------------------------Captured stdout call------------------------------
For icon "img/bmp_icon.bmp": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_icons[GIF static icon] 0.86
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 1, icon = 'img/static_gif.gif'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, icon",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
"img/not_square.png",
]
),
ids=[
"BMP icon",
"GIF static icon",
"PNG animated icon",
"Non image file with a .png extension",
"Icon not square",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_icons(
base_url, session_auth, count, icon, variables
):
"""Verify that requests fail if icons do not meet these acceptance criteria:
PNG or JPG, square images, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(icon, "rb") as img:
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
files={"icon": img},
)
print(
f'For icon "{icon}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:777: AssertionError
------------------------------Captured stdout call------------------------------
For icon "img/static_gif.gif": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_icons[PNG animated icon] 1.01
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 2, icon = 'img/animated_png.png'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, icon",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
"img/not_square.png",
]
),
ids=[
"BMP icon",
"GIF static icon",
"PNG animated icon",
"Non image file with a .png extension",
"Icon not square",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_icons(
base_url, session_auth, count, icon, variables
):
"""Verify that requests fail if icons do not meet these acceptance criteria:
PNG or JPG, square images, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(icon, "rb") as img:
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
files={"icon": img},
)
print(
f'For icon "{icon}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:777: AssertionError
------------------------------Captured stdout call------------------------------
For icon "img/animated_png.png": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_icons[Non image file with a .png extension] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 3, icon = 'img/invalid_image.png'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, icon",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
"img/not_square.png",
]
),
ids=[
"BMP icon",
"GIF static icon",
"PNG animated icon",
"Non image file with a .png extension",
"Icon not square",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_icons(
base_url, session_auth, count, icon, variables
):
"""Verify that requests fail if icons do not meet these acceptance criteria:
PNG or JPG, square images, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(icon, "rb") as img:
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
files={"icon": img},
)
print(
f'For icon "{icon}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:777: AssertionError
------------------------------Captured stdout call------------------------------
For icon "img/invalid_image.png": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_icons[Icon not square] 1.01
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 4, icon = 'img/not_square.png'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, icon",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
"img/not_square.png",
]
),
ids=[
"BMP icon",
"GIF static icon",
"PNG animated icon",
"Non image file with a .png extension",
"Icon not square",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_icons(
base_url, session_auth, count, icon, variables
):
"""Verify that requests fail if icons do not meet these acceptance criteria:
PNG or JPG, square images, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(icon, "rb") as img:
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
files={"icon": img},
)
print(
f'For icon "{icon}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:777: AssertionError
------------------------------Captured stdout call------------------------------
For icon "img/not_square.png": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_valid_screenshots[PNG image] 0.56
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 0, preview = 'img/screenshot_3.png'

@pytest.mark.parametrize(
"count, preview",
enumerate(
[
"img/screenshot_3.png",
"img/screenshot_1.jpg",
]
),
ids=[
"PNG image",
"JPG image",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_valid_screenshots(base_url, session_auth, count, preview):
"""Set valid preview images for an addon; only JPG and JPG formats are accepted"""
addon = payloads.edit_addon_details["slug"]
with open(preview, "rb") as img:
edit_addon = requests.post(
url=f"{base_url}{_addon_create}{addon}/previews/",
headers={"Authorization": f"Session {session_auth}"},
files={"image": img},
data={
"position": count
}, # sets the order in which the previews should appear
)
print(
f'For image "{preview}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 201
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 201
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:814: AssertionError
------------------------------Captured stdout call------------------------------
For image "img/screenshot_3.png": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_valid_screenshots[JPG image] 0.52
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 1, preview = 'img/screenshot_1.jpg'

@pytest.mark.parametrize(
"count, preview",
enumerate(
[
"img/screenshot_3.png",
"img/screenshot_1.jpg",
]
),
ids=[
"PNG image",
"JPG image",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_valid_screenshots(base_url, session_auth, count, preview):
"""Set valid preview images for an addon; only JPG and JPG formats are accepted"""
addon = payloads.edit_addon_details["slug"]
with open(preview, "rb") as img:
edit_addon = requests.post(
url=f"{base_url}{_addon_create}{addon}/previews/",
headers={"Authorization": f"Session {session_auth}"},
files={"image": img},
data={
"position": count
}, # sets the order in which the previews should appear
)
print(
f'For image "{preview}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 201
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 201
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:814: AssertionError
------------------------------Captured stdout call------------------------------
For image "img/screenshot_1.jpg": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_no_image_attached 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_no_image_attached(base_url, session_auth):
"""Send a screenshot upload request without adding an image"""
addon = payloads.edit_addon_details["slug"]
edit_addon = requests.post(
url=f"{base_url}{_addon_create}{addon}/previews/",
headers={"Authorization": f"Session {session_auth}"},
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:862: AssertionError
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_image[BMP screenshot] 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 0, preview = 'img/bmp_icon.bmp'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, preview",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
]
),
ids=[
"BMP screenshot",
"GIF static screenshot",
"PNG animated screenshot",
"Non image file with a .png extension",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_image(
base_url, session_auth, count, preview, variables
):
"""Verify that requests fail if images do not meet these acceptance criteria:
PNG or JPG, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(preview, "rb") as img:
edit_addon = requests.post(
url=f"{base_url}{_addon_create}{addon}/previews/",
headers={"Authorization": f"Session {session_auth}"},
files={"image": img},
)
print(
f'For image "{preview}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:904: AssertionError
------------------------------Captured stdout call------------------------------
For image "img/bmp_icon.bmp": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_image[GIF static screenshot] 0.33
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 1, preview = 'img/static_gif.gif'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, preview",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
]
),
ids=[
"BMP screenshot",
"GIF static screenshot",
"PNG animated screenshot",
"Non image file with a .png extension",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_image(
base_url, session_auth, count, preview, variables
):
"""Verify that requests fail if images do not meet these acceptance criteria:
PNG or JPG, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(preview, "rb") as img:
edit_addon = requests.post(
url=f"{base_url}{_addon_create}{addon}/previews/",
headers={"Authorization": f"Session {session_auth}"},
files={"image": img},
)
print(
f'For image "{preview}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:904: AssertionError
------------------------------Captured stdout call------------------------------
For image "img/static_gif.gif": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_image[PNG animated screenshot] 0.51
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 2, preview = 'img/animated_png.png'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, preview",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
]
),
ids=[
"BMP screenshot",
"GIF static screenshot",
"PNG animated screenshot",
"Non image file with a .png extension",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_image(
base_url, session_auth, count, preview, variables
):
"""Verify that requests fail if images do not meet these acceptance criteria:
PNG or JPG, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(preview, "rb") as img:
edit_addon = requests.post(
url=f"{base_url}{_addon_create}{addon}/previews/",
headers={"Authorization": f"Session {session_auth}"},
files={"image": img},
)
print(
f'For image "{preview}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:904: AssertionError
------------------------------Captured stdout call------------------------------
For image "img/animated_png.png": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_extension_add_invalid_image[Non image file with a .png extension] 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', count = 3, preview = 'img/invalid_image.png'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.parametrize(
"count, preview",
enumerate(
[
"img/bmp_icon.bmp",
"img/static_gif.gif",
"img/animated_png.png",
"img/invalid_image.png",
]
),
ids=[
"BMP screenshot",
"GIF static screenshot",
"PNG animated screenshot",
"Non image file with a .png extension",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_extension_add_invalid_image(
base_url, session_auth, count, preview, variables
):
"""Verify that requests fail if images do not meet these acceptance criteria:
PNG or JPG, non-animated images, valid image file"""
addon = payloads.edit_addon_details["slug"]
with open(preview, "rb") as img:
edit_addon = requests.post(
url=f"{base_url}{_addon_create}{addon}/previews/",
headers={"Authorization": f"Session {session_auth}"},
files={"image": img},
)
print(
f'For image "{preview}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:904: AssertionError
------------------------------Captured stdout call------------------------------
For image "img/invalid_image.png": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_default_locale_with_translations 0.84
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_default_locale_with_translations(base_url, session_auth):
"""Change the 'default_locale' of the addon to another locale for which we
already have translations for the mandatory fields - i.e. 'name' and 'summary'"""
addon = payloads.edit_addon_details["slug"]
# list all the addon translations and try to set them as the default locale
available_translations = ["de", "fr", "ro"]
for locale in available_translations:
# crete a new dictionary from the original payload, with variable values
payload = {**payloads.edit_addon_details, "default_locale": locale}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For locale "{locale}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 200
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:964: AssertionError
------------------------------Captured stdout call------------------------------
For locale "de": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_default_locale_with_missing_translations 0.84
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_default_locale_with_missing_translations(base_url, session_auth):
"""Change the 'default_locale' of the addon to another locale for which we
don't have translations for all the required fields - i.e. 'homepage', 'email'"""
addon = payloads.edit_addon_details["slug"]
# list some locales for which there are n translations and try to set them as the default locale
unavailable_translations = ["pl", "pt-BR"]
for locale in unavailable_translations:
# crete a new dictionary from the original payload, with variable values
payload = {**payloads.edit_addon_details, "default_locale": locale}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For locale "{locale}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:994: AssertionError
------------------------------Captured stdout call------------------------------
For locale "pl": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_addons_edit.py::test_edit_default_locale_invalid_values 1.15
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_default_locale_invalid_values(base_url, session_auth):
"""Use some invalid/unaccepted data types for setting a 'default_locale'"""
addon = payloads.edit_addon_details["slug"]
invalid_locales = ["foo", 123, None, ["de", "fr"], ""]
for locale in invalid_locales:
# crete a new dictionary from the original payload, with variable values
payload = {**payloads.edit_addon_details, "default_locale": locale}
edit_addon = requests.patch(
url=f"{base_url}{_addon_create}{addon}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For locale "{locale}": Response status is {edit_addon.status_code}; {edit_addon.text}\n'
)
> assert (
edit_addon.status_code == 400
), f"Actual status code was {edit_addon.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_addons_edit.py:1024: AssertionError
------------------------------Captured stdout call------------------------------
For locale "foo": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_authors_edit.py::test_addon_add_new_author 0.32
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_add_new_author(base_url, session_auth, variables):
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_valid_author"]
# create the payload with the fields required for a new author set-up
payload = {**payloads.author_stats, "user_id": author, "position": 1}
add_author = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
add_author.status_code == 201
), f"Actual response: {add_author.status_code}, {add_author.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 201
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:36: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_author_decline_invitation 0.31
base_url = 'https://addons.allizom.org', session_auth = 'acwej1luyf5b4lsu7tjq91893hzd2fpk'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("staff_user")
def test_addon_author_decline_invitation(base_url, session_auth, variables):
"""With a user that was invited to become an addon author, decline the invitation received"""
addon = payloads.edit_addon_details["slug"]
decline_invite = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/decline/",
headers={"Authorization": f"Session {session_auth}"},
)
> assert (
decline_invite.status_code == 200
), f"Actual response: {decline_invite.status_code}, {decline_invite.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action."}
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:52: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_add_author_without_display_name 0.29
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_add_author_without_display_name(base_url, session_auth, variables):
"""It is mandatory for a user to have a display name set in order to be accepted as an addon author"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_author_no_display_name"]
payload = {"user_id": author, "position": 2}
add_author = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
add_author.status_code == 400
), f"Actual response: {add_author.status_code}, {add_author.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:88: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_add_restricted_author 0.32
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_add_restricted_author(base_url, session_auth, variables):
"""If a user is added to the email restriction list, it is not possible to add it as an addon author"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_author_no_dev_agreement"]
payload = {"user_id": author, "position": 2}
add_author = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
add_author.status_code == 400
), f"Actual response {add_author.status_code}, {add_author.text}"
E AssertionError: Actual response 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:112: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_add_invalid_authors 0.32
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_add_invalid_authors(base_url, session_auth, variables):
"""Try to add a non exiting user as an addon author"""
addon = payloads.edit_addon_details["slug"]
payload = {**payloads.author_stats, "user_id": 9999999999, "position": 2}
add_author = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
add_author.status_code == 400
), f"Actual response {add_author.status_code}, {add_author.text}"
E AssertionError: Actual response 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:135: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_confirm_invitation_with_wrong_user 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_confirm_invitation_with_wrong_user(base_url, session_auth, variables):
"""Send an author invitation to a user and try to confirm the invite with a different user"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_valid_author"]
payload = {**payloads.author_stats, "user_id": author, "position": 1}
add_author = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
add_author.status_code == 201
), f"Actual response {add_author.status_code}, {add_author.text}"
E AssertionError: Actual response 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 201
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:158: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_list_pending_authors 0.30
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_list_pending_authors(base_url, session_auth, variables):
"""Check that users invited to become addon authors are listed in the pending authors queue"""
addon = payloads.edit_addon_details["slug"]
# this is the author that should be pending for confirmation
author = variables["api_post_valid_author"]
get_pending_authors = requests.get(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={"Authorization": f"Session {session_auth}"},
)
> get_pending_authors.raise_for_status()

tests/api/test_api_authors_edit.py:182:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/pending-authors/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_authors_edit.py::test_addon_get_pending_author_details 0.28
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_get_pending_author_details(base_url, session_auth, variables):
"""Check that the author details (role, position, visibility) set up in the request
are returned in the pending author details API"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_valid_author"]
get_pending_author_details = requests.get(
url=f"{base_url}{_addon_create}{addon}/pending-authors/{author}/",
headers={"Authorization": f"Session {session_auth}"},
)
> get_pending_author_details.raise_for_status()

tests/api/test_api_authors_edit.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/pending-authors/11688808/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_authors_edit.py::test_addon_edit_pending_author 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_edit_pending_author(base_url, session_auth, variables):
"""As the user who initiated the author request, edit the details (role, visibility) of
the invite and make sure that the changes are applied correctly"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_valid_author"]
payload = {"role": "owner", "listed": True}
edit_pending_author_details = requests.patch(
url=f"{base_url}{_addon_create}{addon}/pending-authors/{author}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> edit_pending_author_details.raise_for_status()

tests/api/test_api_authors_edit.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/pending-authors/11688808/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_authors_edit.py::test_addon_delete_pending_author 0.30
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_delete_pending_author(base_url, session_auth, variables):
"""As the user who initiated the author request, delete the invite before the
new author had the chance to confirm it"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_valid_author"]
delete_pending_author = requests.delete(
url=f"{base_url}{_addon_create}{addon}/pending-authors/{author}/",
headers={"Authorization": f"Session {session_auth}"},
)
> assert (
delete_pending_author.status_code == 204
), f"Actual response: {delete_pending_author.status_code}, {delete_pending_author.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 204
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:240: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_invite_multiple_authors 0.29
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_invite_multiple_authors(base_url, session_auth, variables):
"""Check that an addon owner can invite multiple users to become addon authors
in addition to the one added previously"""
addon = payloads.edit_addon_details["slug"]
# invite the first author
first_author = variables["api_post_valid_author"]
payload = {**payloads.author_stats, "user_id": first_author, "position": 1}
first_invite = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
first_invite.status_code == 201
), f"Actual response: {first_invite.status_code}, {first_invite.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 201
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:276: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_invite_same_author_twice 0.30
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_invite_same_author_twice(base_url, session_auth, variables):
"""Check that an author can only be invited once, if the invitation is still active"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_additional_author"]
payload = {**payloads.author_stats, "user_id": author, "position": 2}
duplicate_invite = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
duplicate_invite.status_code == 400
), f"Actual response: {duplicate_invite.status_code}, {duplicate_invite.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:320: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_confirm_invitation_with_correct_user 0.31
base_url = 'https://addons.allizom.org', session_auth = 'acwej1luyf5b4lsu7tjq91893hzd2fpk'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("staff_user")
def test_addon_confirm_invitation_with_correct_user(base_url, session_auth, variables):
addon = payloads.edit_addon_details["slug"]
accept_invite = requests.post(
url=f"{base_url}{_addon_create}{addon}/pending-authors/confirm/",
headers={"Authorization": f"Session {session_auth}"},
)
> assert (
accept_invite.status_code == 200
), f"Actual response: {accept_invite.status_code}, {accept_invite.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action."}
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:336: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_list_active_authors 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_list_active_authors(base_url, session_auth, variables):
"""Verify that the list of active addon authors contains only the confirmed users"""
addon_owner = variables["api_addon_author_owner"]
additional_author = variables["api_post_valid_author"]
addon = payloads.edit_addon_details["slug"]
get_authors = requests.get(
url=f"{base_url}{_addon_create}{addon}/authors/",
headers={"Authorization": f"Session {session_auth}"},
)
response = get_authors.json()
# we should have only two valid authors for this addon
> assert len(response) == 2
E AssertionError: assert 3 == 2
E + where 3 = len({'detail': 'You do not have permission to perform this action.', 'is_disabled_by_developer': False, 'is_disabled_by_mozilla': False})

tests/api/test_api_authors_edit.py:429: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_author_owner_is_required 0.30
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_author_owner_is_required(base_url, session_auth, variables):
"""Try to downgrade the current single addon owner to a developer role.
The request should fail as an addon requires at least one active owner"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_addon_author_owner"]
edit_author = requests.patch(
url=f"{base_url}{_addon_create}{addon}/authors/{author}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps({"role": "developer"}),
)
> assert (
edit_author.status_code == 400
), f"Actual response: {edit_author.status_code}, {edit_author.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:449: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_one_listed_author_is_required 0.30
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_one_listed_author_is_required(base_url, session_auth, variables):
"""Check that an addon needs to have at least one author listed on the site"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_addon_author_owner"]
edit_author = requests.patch(
url=f"{base_url}{_addon_create}{addon}/authors/{author}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps({"listed": False}),
)
> assert (
edit_author.status_code == 400
), f"Actual response: {edit_author.status_code}, {edit_author.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:471: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_change_non_active_author_details 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_change_non_active_author_details(base_url, session_auth):
"""Try to edit the details of a user that is not listed as an addon author
and make sure no unexpected errors are raised"""
addon = payloads.edit_addon_details["slug"]
edit_author = requests.patch(
url=f"{base_url}{_addon_create}{addon}/authors/0123/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payloads.author_stats),
)
> assert (
edit_author.status_code == 404
), f"Actual response: {edit_author.status_code}, {edit_author.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 404
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:493: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_delete_owner_author 0.31
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_delete_owner_author(base_url, session_auth, variables):
"""Check that the only owner of an addon cannot be deleted"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_addon_author_owner"]
delete_owner = requests.delete(
url=f"{base_url}{_addon_create}{addon}/authors/{author}/",
headers={"Authorization": f"Session {session_auth}"},
)
> assert (
delete_owner.status_code == 400
), f"Actual response: {delete_owner.status_code}, {delete_owner.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:527: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_developer_role_can_request_author_details[Desktop] 6.18
selenium = <selenium.webdriver.firefox.webdriver.WebDriver (session="f7eaa211-c195-495b-a517-5cd59b6fcddd")>, base_url = 'https://addons.allizom.org'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}
session_auth = 'acwej1luyf5b4lsu7tjq91893hzd2fpk'

@pytest.mark.serial
@pytest.mark.create_session("staff_user")
@pytest.mark.clear_session
def test_addon_developer_role_can_request_author_details(
selenium, base_url, variables, session_auth
):
"""Verify that an author with a developer role can view details for existing addon authors"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_valid_author"]
# send the patch author requests with the developer role
get_author_details = requests.get(
url=f"{base_url}{_addon_create}{addon}/authors/{author}/",
headers={"Authorization": f"Session {session_auth}"},
)
> assert (
get_author_details.status_code == 200
), f"Actual response: {get_author_details.status_code}, {get_author_details.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:610: AssertionError
Failed tests/api/test_api_authors_edit.py::test_addon_change_author_stats 0.29
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_change_author_stats(base_url, session_auth, variables):
"""Change the details - role, visibility, position - of an exiting author
and verify that changes were applied correctly"""
addon = payloads.edit_addon_details["slug"]
author = variables["api_post_valid_author"]
payload = {**payloads.author_stats, "role": "owner", "position": 0, "listed": True}
edit_author = requests.patch(
url=f"{base_url}{_addon_create}{addon}/authors/{author}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> edit_author.raise_for_status()

tests/api/test_api_authors_edit.py:634:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/authors/11688808/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_authors_edit.py::test_addon_delete_all_active_and_pending_authors 0.30
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_addon_delete_all_active_and_pending_authors(base_url, session_auth, variables):
"""As the addon owner, delete all additional authors (pending or active)"""
addon = payloads.edit_addon_details["slug"]
active_author = variables["api_post_valid_author"]
pending_author = variables["api_post_additional_author"]
# delete active author (invitation accepted)
delete_active_author = requests.delete(
url=f"{base_url}{_addon_create}{addon}/authors/{active_author}/",
headers={"Authorization": f"Session {session_auth}"},
)
> assert (
delete_active_author.status_code == 204
), f"Actual response: {delete_active_author.status_code}, {delete_active_author.text}"
E AssertionError: Actual response: 403, {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 204
E + where 403 = <Response [403]>.status_code

tests/api/test_api_authors_edit.py:653: AssertionError
Failed tests/api/test_api_versions_edit.py::test_edit_version_details 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_details(base_url, session_auth):
"""Edit the version specific fields, i.e. 'release_notes', 'license, 'compatibility'"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = payloads.edit_version_details
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> edit_version.raise_for_status()

tests/api/test_api_versions_edit.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/versions/3728526/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_versions_edit.py::test_edit_version_custom_license_no_text 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_custom_license_no_text(base_url, session_auth):
"""When setting a custom license, it is mandatory for that license to contain a text"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {
**payloads.custom_license,
"custom_license": {"name": {"en-US": "no-text-provided"}},
}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:78: AssertionError
Failed tests/api/test_api_versions_edit.py::test_edit_version_set_custom_license 1.02
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_set_custom_license(base_url, session_auth):
"""Instead of using a predefined addon license provided by AMO, add a
custom license with 'name' and 'text' defined by the addon author"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = payloads.custom_license
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> edit_version.raise_for_status()

tests/api/test_api_versions_edit.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/versions/3728526/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_versions_edit.py::test_upload_new_listed_version 6.22
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
@pytest.mark.fail
def test_upload_new_listed_version(base_url, session_auth):
"""Uploads a new listed version for an existing addon"""
with open("sample-addons/listed-addon-new-version.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "listed"},
)
time.sleep(5)
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
addon = payloads.edit_addon_details["slug"]
payload = payloads.new_version_details(uuid)
new_version = requests.post(
url=f"{base_url}{_addon_create}{addon}/versions/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> new_version.raise_for_status()

tests/api/test_api_versions_edit.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/versions/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_versions_edit.py::test_upload_new_version_with_existing_version_number 6.17
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
@pytest.mark.fail
def test_upload_new_version_with_existing_version_number(base_url, session_auth):
"""Uploads a new version with an existing version number; the upload should fail"""
with open("sample-addons/listed-addon-new-version.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "listed"},
)
time.sleep(5)
print("Post upload json: " + f"{upload}")
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
print("UUID json: " + f"{uuid}")
addon = payloads.edit_addon_details["slug"]
print("addon json: " + f"{addon}")
payload = payloads.new_version_details(uuid)
print("payload json: " + f"{payload}")
new_version = requests.post(
url=f"{base_url}{_addon_create}{addon}/versions/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print("payload json: " + f"{new_version}")
> assert (
new_version.status_code == 409
), f"Actual response: status code = {new_version.status_code}, message = {new_version.text}"
E AssertionError: Actual response: status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 409
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:179: AssertionError
------------------------------Captured stdout call------------------------------
Post upload json: <Response [201]> UUID json: 9940434f94d24747b7adc25b836ff267 addon json: new_sluggish_slug payload json: {'upload': '9940434f94d24747b7adc25b836ff267', 'license': 'ISC', 'release_notes': {'de': 'New Version DE notes added in API at addon creation time', 'en-US': 'New Version EN-US notes added in API at addon creation time', 'fr': 'New Version FR notes added in API at addon creation time'}, 'compatibility': {'android': {'min': '121.0a1', 'max': '*'}, 'firefox': {'min': '70.0a1', 'max': '*'}}} payload json: <Response [403]>
Failed tests/api/test_api_versions_edit.py::test_upload_new_unlisted_version_with_put_method 7.15
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_upload_new_unlisted_version_with_put_method(base_url, session_auth):
"""Takes an addon with listed version only and submits an unlisted version;
this is creating an addon with mixed versions. Use the PUT endpoint in this
case to check that it also works for a new version submission process"""
addon = payloads.edit_addon_details["slug"]
# get the addon guid required for the PUT method
get_addon_details = requests.get(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
)
guid = get_addon_details.json()["guid"]
# upload a new unlisted version
with open("sample-addons/mixed-addon-versions.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "unlisted"},
)
time.sleep(5)
upload.raise_for_status()
resp = upload.json()
# verify that the upload was created as unlisted
assert "unlisted" in resp["channel"]
# get the addon uuid generated after upload
uuid = resp["uuid"]
new_version = requests.put(
url=f"{base_url}{_addon_create}{guid}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps({"version": {"upload": uuid}}),
)
> new_version.raise_for_status()

tests/api/test_api_versions_edit.py:223:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/%7B01e585a7-c93f-4d18-9f4d-9e7ada502914%7D/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Failed tests/api/test_api_versions_edit.py::test_upload_new_version_with_different_addon_type 6.20
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_upload_new_version_with_different_addon_type(base_url, session_auth):
"""Take an exiting addon of type 'extensions' and try to upload a new version
of type 'statictheme' for it; the submission should fail"""
with open("sample-addons/theme.xpi", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "listed"},
)
time.sleep(5)
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
addon = payloads.edit_addon_details["slug"]
payload = {"upload": uuid}
new_version = requests.post(
url=f"{base_url}{_addon_create}{addon}/versions/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
new_version.status_code == 400
), f"Actual response: status code = {new_version.status_code}, message = {new_version.text}"
E AssertionError: Actual response: status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:255: AssertionError
Failed tests/api/test_api_versions_edit.py::test_upload_new_version_with_different_guid 6.22
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_upload_new_version_with_different_guid(base_url, session_auth):
"""Take an exiting addon and submit a new version that has a different GUID
from what we have on AMO for this addon; the submission should fail"""
guid = f"random-guid@{reusables.get_random_string(6)}"
# create the addon manifest to be uploaded
manifest = {
**payloads.minimal_manifest,
"version": "2.0",
"name": "New version with different guid",
"browser_specific_settings": {"gecko": {"id": guid}},
}
api_helpers.make_addon(manifest)
with open("sample-addons/make-addon.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "listed"},
)
time.sleep(5)
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
addon = payloads.edit_addon_details["slug"]
payload = {"upload": uuid}
new_version = requests.post(
url=f"{base_url}{_addon_create}{addon}/versions/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
new_version.status_code == 400
), f"Actual response: status code = {new_version.status_code}, message = {new_version.text}"
E AssertionError: Actual response: status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:299: AssertionError
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '2.0', 'name': 'New version with different guid', 'browser_specific_settings': {'gecko': {'id': 'random-guid@pehaox'}}}
Failed tests/api/test_api_versions_edit.py::test_upload_new_version_with_sources 6.35
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_upload_new_version_with_sources(base_url, session_auth):
"""Uploads a new version for an exiting addon while also attaching additional source code"""
manifest = {
**payloads.minimal_manifest,
"name": "EN-US Name edited",
"version": "3.0",
}
api_helpers.make_addon(manifest)
with open("sample-addons/make-addon.zip", "rb") as file:
upload = requests.post(
url=f"{base_url}{_upload}",
headers={"Authorization": f"Session {session_auth}"},
files={"upload": file},
data={"channel": "listed"},
)
time.sleep(5)
upload.raise_for_status()
# get the addon uuid generated after upload
uuid = upload.json()["uuid"]
addon = payloads.edit_addon_details["slug"]
# submit the version and attach source code
with open("sample-addons/listed-addon.zip", "rb") as source:
new_version = requests.post(
url=f"{base_url}{_addon_create}{addon}/versions/",
headers={"Authorization": f"Session {session_auth}"},
data={"upload": uuid},
files={"source": source},
)
response = new_version.json()
> new_version.raise_for_status()

tests/api/test_api_versions_edit.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/versions/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '3.0', 'name': 'EN-US Name edited'}
Failed tests/api/test_api_versions_edit.py::test_edit_version_change_sources 0.98
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_change_sources(base_url, session_auth):
"""Upload different source file for an existing version and make sure that changes were applied"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
print("Request addon create: " + f"{request.json()}")
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
get_old_source = requests.get(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={"Authorization": f"Session {session_auth}"},
)
print("get old source request: " + f"{get_old_source.json()}")
# download the previous source code attached to the version
previous_source = requests.get(
> get_old_source.json()["source"], cookies={"sessionid": session_auth}, timeout=10
)
E KeyError: 'source'

tests/api/test_api_versions_edit.py:369: KeyError
------------------------------Captured stdout call------------------------------
Request addon create: {'id': 2243899, 'authors': [{'id': 11688815, 'name': 'admin', 'url': 'https://addons.allizom.org/en-US/firefox/user/11688815/', 'username': 'anonymous-abd97401081cfbfb5f345355b48242a7', 'picture_url': None}], 'average_daily_users': 0, 'categories': ['privacy-security', 'bookmarks'], 'contributions_url': {'url': 'https://www.patreon.com?utm_content=product-page-contribute&utm_medium=referral&utm_source=addons.mozilla.org', 'outgoing': 'https://stage.outgoing.nonprod.webservices.mozgcp.net/v1/82d715c26f17f251858d1516b5647fb5c33a03d4a15bf12619943cbb44fd1d88/https%3A//www.patreon.com%3Futm_content=product-page-contribute&utm_medium=referral&utm_source=addons.mozilla.org'}, 'created': '2024-12-06T13:32:53Z', 'current_version': {'id': 3728526, 'compatibility': {'firefox': {'min': '89.0', 'max': '100.*'}, 'android': {'min': '121.0a1', 'max': '*'}}, 'edit_url': 'https://addons.allizom.org/en-US/developers/addon/new_sluggish_slug/versions/3728526', 'file': {'id': 2346894, 'created': '2024-12-06T13:32:54Z', 'hash': 'sha256:dfeeea052558ae9c3bca30b861a65682614f512d111cd5887526c056394ae940', 'is_mozilla_signed_extension': False, 'size': 8231, 'status': 'public', 'url': 'https://addons.allizom.org/firefox/downloads/file/2346894/new_sluggish_slug-1.0.xpi', 'permissions': [], 'optional_permissions': [], 'host_permissions': []}, 'is_strict_compatibility_enabled': False, 'license': {'id': 5045, 'is_custom': False, 'name': {'en-US': 'All Rights Reserved'}, 'slug': 'all-rights-reserved', 'url': None}, 'release_notes': {'de': 'DE Version notes added in API at addon creation time', 'en-US': 'EN-US Version notes added in API at addon creation time', 'fr': 'FR Version notes added in API at addon creation time'}, 'reviewed': '2024-12-06T13:35:10Z', 'version': '1.0'}, 'default_locale': 'en-US', 'description': {'de': 'Description in german', 'en-US': 'Description in en-US', 'fr': 'Description in french'}, 'developer_comments': {'de': 'Dev comments in german', 'en-US': 'Dev comments in en-US', 'fr': 'Dev comments in french'}, 'edit_url': 'https://addons.allizom.org/en-US/developers/addon/new_sluggish_slug/edit', 'guid': '{01e585a7-c93f-4d18-9f4d-9e7ada502914}', 'has_eula': False, 'has_privacy_policy': False, 'homepage': {'url': {'de': 'https://addons.not-allizom.de', 'en-US': 'https://addons.not-allizom.org', 'fr': 'https://addons.not-allizom.fr'}, 'outgoing': {'de': 'https://stage.outgoing.nonprod.webservices.mozgcp.net/v1/b48a84f06dd1ad1473a915ebac3928fcb3b2ad646de8f991b313e04942f0bdc0/https%3A//addons.not-allizom.de', 'en-US': 'https://stage.outgoing.nonprod.webservices.mozgcp.net/v1/b91dae3f00b1f02b4c712a957c2a16016af76e9f01b1b1da21f819f308842e74/https%3A//addons.not-allizom.org', 'fr': 'https://stage.outgoing.nonprod.webservices.mozgcp.net/v1/324619d551662c5e7ef32ae10be62dc5b34eeffcbc7370e7bd22558c765052d9/https%3A//addons.not-allizom.fr'}}, 'icon_url': 'https://addons.allizom.org/static-server/img/addon-icons/default-64.d144b50f2bb8.png', 'icons': {'32': 'https://addons.allizom.org/static-server/img/addon-icons/default-32.2b26add4b394.png', '64': 'https://addons.allizom.org/static-server/img/addon-icons/default-64.d144b50f2bb8.png', '128': 'https://addons.allizom.org/static-server/img/addon-icons/default-128.452018499894.png'}, 'is_disabled': False, 'is_experimental': True, 'last_updated': '2024-12-06T13:35:10Z', 'name': {'de': 'DE Name set at creation time', 'en-US': 'EN-US Name set at creation time', 'fr': 'FR Name set at creation time'}, 'previews': [], 'promoted': None, 'ratings': {'average': 0.0, 'bayesian_average': 0.0, 'count': 0, 'text_count': 0}, 'ratings_url': 'https://addons.allizom.org/en-US/firefox/addon/new_sluggish_slug/reviews/', 'requires_payment': True, 'review_url': 'https://addons.allizom.org/en-US/reviewers/review/2243899', 'slug': 'new_sluggish_slug', 'status': 'public', 'summary': {'de': 'Summary, in german', 'en-US': 'Summary, in en-US', 'fr': 'Summary, in french'}, 'support_email': {'de': 'lang-de@mail.com', 'en-US': 'lang-en-us@mail.com', 'fr': 'lang-fr@mail.com'}, 'support_url': None, 'tags': ['anti malware', 'anti tracker', 'antivirus', 'chat', 'container', 'content blocker', 'coupon', 'dailymotion', 'dark mode'], 'type': 'extension', 'url': 'https://addons.allizom.org/en-US/firefox/addon/new_sluggish_slug/', 'versions_url': 'https://addons.allizom.org/en-US/firefox/addon/new_sluggish_slug/versions/', 'weekly_downloads': 0} get old source request: {'id': 3728526, 'channel': 'listed', 'compatibility': {'firefox': {'min': '89.0', 'max': '100.*'}, 'android': {'min': '121.0a1', 'max': '*'}}, 'edit_url': 'https://addons.allizom.org/en-US/developers/addon/new_sluggish_slug/versions/3728526', 'file': {'id': 2346894, 'created': '2024-12-06T13:32:54Z', 'hash': 'sha256:dfeeea052558ae9c3bca30b861a65682614f512d111cd5887526c056394ae940', 'is_mozilla_signed_extension': False, 'size': 8231, 'status': 'public', 'url': 'https://addons.allizom.org/firefox/downloads/file/2346894/new_sluggish_slug-1.0.xpi', 'permissions': [], 'optional_permissions': [], 'host_permissions': []}, 'is_strict_compatibility_enabled': False, 'license': {'id': 5045, 'is_custom': False, 'name': {'en-US': 'All Rights Reserved'}, 'slug': 'all-rights-reserved', 'text': None, 'url': None}, 'release_notes': {'de': 'DE Version notes added in API at addon creation time', 'en-US': 'EN-US Version notes added in API at addon creation time', 'fr': 'FR Version notes added in API at addon creation time'}, 'reviewed': '2024-12-06T13:35:10Z', 'version': '1.0'}
Failed tests/api/test_api_versions_edit.py::test_edit_version_upload_supported_source_files[Archive in "tar.bz2" format] 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', file_type = 'tar-bz2-ext.tar.bz2'

@pytest.mark.parametrize(
"file_type",
[
"tar-bz2-ext.tar.bz2",
"tgz-ext.tgz",
"tar-gz-ext.tar.gz",
],
ids=[
'Archive in "tar.bz2" format',
'Archive in "tgz" format',
'Archive in "tar.gz" format',
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_upload_supported_source_files(base_url, session_auth, file_type):
"""Upload all the supported source file types and make sure the request is successful"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
with open(f"sample-addons/{file_type}", "rb") as file:
upload_source = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={"Authorization": f"Session {session_auth}"},
files={"source": file},
)
print(upload_source)
> assert (
upload_source.status_code == 200
), f'For file_type "{file_type}", status code = {upload_source.status_code}, message = {upload_source.text}'
E AssertionError: For file_type "tar-bz2-ext.tar.bz2", status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:423: AssertionError
------------------------------Captured stdout call------------------------------
<Response [403]>
Failed tests/api/test_api_versions_edit.py::test_edit_version_upload_supported_source_files[Archive in "tgz" format] 0.90
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', file_type = 'tgz-ext.tgz'

@pytest.mark.parametrize(
"file_type",
[
"tar-bz2-ext.tar.bz2",
"tgz-ext.tgz",
"tar-gz-ext.tar.gz",
],
ids=[
'Archive in "tar.bz2" format',
'Archive in "tgz" format',
'Archive in "tar.gz" format',
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_upload_supported_source_files(base_url, session_auth, file_type):
"""Upload all the supported source file types and make sure the request is successful"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
with open(f"sample-addons/{file_type}", "rb") as file:
upload_source = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={"Authorization": f"Session {session_auth}"},
files={"source": file},
)
print(upload_source)
> assert (
upload_source.status_code == 200
), f'For file_type "{file_type}", status code = {upload_source.status_code}, message = {upload_source.text}'
E AssertionError: For file_type "tgz-ext.tgz", status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:423: AssertionError
------------------------------Captured stdout call------------------------------
<Response [403]>
Failed tests/api/test_api_versions_edit.py::test_edit_version_upload_supported_source_files[Archive in "tar.gz" format] 0.83
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', file_type = 'tar-gz-ext.tar.gz'

@pytest.mark.parametrize(
"file_type",
[
"tar-bz2-ext.tar.bz2",
"tgz-ext.tgz",
"tar-gz-ext.tar.gz",
],
ids=[
'Archive in "tar.bz2" format',
'Archive in "tgz" format',
'Archive in "tar.gz" format',
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_upload_supported_source_files(base_url, session_auth, file_type):
"""Upload all the supported source file types and make sure the request is successful"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
with open(f"sample-addons/{file_type}", "rb") as file:
upload_source = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={"Authorization": f"Session {session_auth}"},
files={"source": file},
)
print(upload_source)
> assert (
upload_source.status_code == 200
), f'For file_type "{file_type}", status code = {upload_source.status_code}, message = {upload_source.text}'
E AssertionError: For file_type "tar-gz-ext.tar.gz", status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:423: AssertionError
------------------------------Captured stdout call------------------------------
<Response [403]>
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_license[Empty string] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', slug = ''

@pytest.mark.parametrize(
"slug",
[
"",
None,
False,
123,
"random slug",
{"value": "some value"},
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
"Dictionary",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_license(base_url, session_auth, slug):
"""Extension license slugs have to match one of the predefined licenses accepted by AMO"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "license": slug}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For license slug "{slug}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:506: AssertionError
------------------------------Captured stdout call------------------------------
For license slug "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_license[None/No value] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', slug = None

@pytest.mark.parametrize(
"slug",
[
"",
None,
False,
123,
"random slug",
{"value": "some value"},
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
"Dictionary",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_license(base_url, session_auth, slug):
"""Extension license slugs have to match one of the predefined licenses accepted by AMO"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "license": slug}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For license slug "{slug}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:506: AssertionError
------------------------------Captured stdout call------------------------------
For license slug "None": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_license[Boolean] 0.93
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', slug = False

@pytest.mark.parametrize(
"slug",
[
"",
None,
False,
123,
"random slug",
{"value": "some value"},
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
"Dictionary",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_license(base_url, session_auth, slug):
"""Extension license slugs have to match one of the predefined licenses accepted by AMO"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "license": slug}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For license slug "{slug}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:506: AssertionError
------------------------------Captured stdout call------------------------------
For license slug "False": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_license[Integer] 0.90
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', slug = 123

@pytest.mark.parametrize(
"slug",
[
"",
None,
False,
123,
"random slug",
{"value": "some value"},
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
"Dictionary",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_license(base_url, session_auth, slug):
"""Extension license slugs have to match one of the predefined licenses accepted by AMO"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "license": slug}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For license slug "{slug}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:506: AssertionError
------------------------------Captured stdout call------------------------------
For license slug "123": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_license[Random string] 0.84
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', slug = 'random slug'

@pytest.mark.parametrize(
"slug",
[
"",
None,
False,
123,
"random slug",
{"value": "some value"},
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
"Dictionary",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_license(base_url, session_auth, slug):
"""Extension license slugs have to match one of the predefined licenses accepted by AMO"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "license": slug}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For license slug "{slug}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:506: AssertionError
------------------------------Captured stdout call------------------------------
For license slug "random slug": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_license[Dictionary] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', slug = {'value': 'some value'}

@pytest.mark.parametrize(
"slug",
[
"",
None,
False,
123,
"random slug",
{"value": "some value"},
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
"Dictionary",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_license(base_url, session_auth, slug):
"""Extension license slugs have to match one of the predefined licenses accepted by AMO"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "license": slug}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For license slug "{slug}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:506: AssertionError
------------------------------Captured stdout call------------------------------
For license slug "{'value': 'some value'}": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_both_license_and_custom_license 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_both_license_and_custom_license(base_url, session_auth):
"""An addon can have either a predefined license or a custom license but not both"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
# add a custom license besides the 'license' we already have in the edit version payload
payload = {
**payloads.edit_version_details,
"custom_license": {"name": {"en-US": "custom-name"}},
}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:543: AssertionError
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_custom_license_format[Empty string] 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = ''

@pytest.mark.parametrize(
"value",
[
"",
"all-rights-reserved",
123,
None,
False,
],
ids=[
"Empty string",
"Built in license",
"Integer",
"None/No value",
"Boolean",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_custom_license_format(base_url, session_auth, value):
"""Custom licenses should be a dictionary containing the license name and text; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.custom_license, "custom_license": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For custom_license "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:593: AssertionError
------------------------------Captured stdout call------------------------------
For custom_license "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_custom_license_format[Built in license] 0.84
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = 'all-rights-reserved'

@pytest.mark.parametrize(
"value",
[
"",
"all-rights-reserved",
123,
None,
False,
],
ids=[
"Empty string",
"Built in license",
"Integer",
"None/No value",
"Boolean",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_custom_license_format(base_url, session_auth, value):
"""Custom licenses should be a dictionary containing the license name and text; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.custom_license, "custom_license": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For custom_license "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:593: AssertionError
------------------------------Captured stdout call------------------------------
For custom_license "all-rights-reserved": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_custom_license_format[Integer] 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = 123

@pytest.mark.parametrize(
"value",
[
"",
"all-rights-reserved",
123,
None,
False,
],
ids=[
"Empty string",
"Built in license",
"Integer",
"None/No value",
"Boolean",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_custom_license_format(base_url, session_auth, value):
"""Custom licenses should be a dictionary containing the license name and text; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.custom_license, "custom_license": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For custom_license "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:593: AssertionError
------------------------------Captured stdout call------------------------------
For custom_license "123": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_custom_license_format[None/No value] 0.86
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = None

@pytest.mark.parametrize(
"value",
[
"",
"all-rights-reserved",
123,
None,
False,
],
ids=[
"Empty string",
"Built in license",
"Integer",
"None/No value",
"Boolean",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_custom_license_format(base_url, session_auth, value):
"""Custom licenses should be a dictionary containing the license name and text; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.custom_license, "custom_license": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For custom_license "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:593: AssertionError
------------------------------Captured stdout call------------------------------
For custom_license "None": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_custom_license_format[Boolean] 0.86
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = False

@pytest.mark.parametrize(
"value",
[
"",
"all-rights-reserved",
123,
None,
False,
],
ids=[
"Empty string",
"Built in license",
"Integer",
"None/No value",
"Boolean",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_custom_license_format(base_url, session_auth, value):
"""Custom licenses should be a dictionary containing the license name and text; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.custom_license, "custom_license": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For custom_license "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:593: AssertionError
------------------------------Captured stdout call------------------------------
For custom_license "False": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_custom_license_name_and_text[Not a dictionary] 0.86
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = ''

@pytest.mark.parametrize(
"value",
[
"",
{"foo": "string"},
],
ids=[
"Not a dictionary",
"Invalid locale",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_custom_license_name_and_text(
base_url, session_auth, value
):
"""Custom licenses should be a dictionary containing the license name and text;
also, the name and text need to be specified in a valid locale"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {
**payloads.custom_license,
"custom_license": {"name": value, "text": value},
}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For custom_license "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:647: AssertionError
------------------------------Captured stdout call------------------------------
For custom_license "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_custom_license_name_and_text[Invalid locale] 0.86
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = {'foo': 'string'}

@pytest.mark.parametrize(
"value",
[
"",
{"foo": "string"},
],
ids=[
"Not a dictionary",
"Invalid locale",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_custom_license_name_and_text(
base_url, session_auth, value
):
"""Custom licenses should be a dictionary containing the license name and text;
also, the name and text need to be specified in a valid locale"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {
**payloads.custom_license,
"custom_license": {"name": value, "text": value},
}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For custom_license "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:647: AssertionError
------------------------------Captured stdout call------------------------------
For custom_license "{'foo': 'string'}": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_format[Empty string] 0.88
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = ''

@pytest.mark.parametrize(
"value",
[
"",
None,
False,
123,
"random string",
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_format(base_url, session_auth, value):
"""The compatibility field needs to be either a dictionary or a list; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:701: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_format[None/No value] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = None

@pytest.mark.parametrize(
"value",
[
"",
None,
False,
123,
"random string",
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_format(base_url, session_auth, value):
"""The compatibility field needs to be either a dictionary or a list; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:701: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "None": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_format[Boolean] 0.88
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = False

@pytest.mark.parametrize(
"value",
[
"",
None,
False,
123,
"random string",
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_format(base_url, session_auth, value):
"""The compatibility field needs to be either a dictionary or a list; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:701: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "False": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_format[Integer] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = 123

@pytest.mark.parametrize(
"value",
[
"",
None,
False,
123,
"random string",
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_format(base_url, session_auth, value):
"""The compatibility field needs to be either a dictionary or a list; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:701: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "123": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_format[Random string] 0.91
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = 'random string'

@pytest.mark.parametrize(
"value",
[
"",
None,
False,
123,
"random string",
],
ids=[
"Empty string",
"None/No value",
"Boolean",
"Integer",
"Random string",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_format(base_url, session_auth, value):
"""The compatibility field needs to be either a dictionary or a list; other formats should fail"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:701: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "random string": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_valid_compatibility_values[Compatibility in list format, valid apps (firefox and android)] 0.91
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', request_value = ['android', 'firefox']
response_value = {'android': {'max': '*', 'min': '120.0'}, 'firefox': {'max': '*', 'min': '58.0'}}

@pytest.mark.parametrize(
"request_value, response_value",
[
(
["android", "firefox"],
{
"android": {"min": "120.0", "max": "*"},
"firefox": {"min": "58.0", "max": "*"},
},
),
(["firefox"], {"firefox": {"min": "58.0", "max": "*"}}),
({"firefox": {"min": "65.0"}}, {"firefox": {"min": "65.0", "max": "*"}})
],
ids=[
"Compatibility in list format, valid apps (firefox and android)",
"Compatibility in list format, only firefox compatibility",
"Valid app - firefox and valid appversion"
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_valid_compatibility_values(
base_url, session_auth, request_value, response_value
):
"""Tests the compatibility field with a set of valid values"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
print(request)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": request_value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(edit_version)
print(
f'For compatibility "{request_value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
r = edit_version.json()
> assert (
edit_version.status_code == 200
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:762: AssertionError
------------------------------Captured stdout call------------------------------
<Response [200]> <Response [403]> For compatibility "['android', 'firefox']": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_valid_compatibility_values[Compatibility in list format, only firefox compatibility] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', request_value = ['firefox'], response_value = {'firefox': {'max': '*', 'min': '58.0'}}

@pytest.mark.parametrize(
"request_value, response_value",
[
(
["android", "firefox"],
{
"android": {"min": "120.0", "max": "*"},
"firefox": {"min": "58.0", "max": "*"},
},
),
(["firefox"], {"firefox": {"min": "58.0", "max": "*"}}),
({"firefox": {"min": "65.0"}}, {"firefox": {"min": "65.0", "max": "*"}})
],
ids=[
"Compatibility in list format, valid apps (firefox and android)",
"Compatibility in list format, only firefox compatibility",
"Valid app - firefox and valid appversion"
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_valid_compatibility_values(
base_url, session_auth, request_value, response_value
):
"""Tests the compatibility field with a set of valid values"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
print(request)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": request_value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(edit_version)
print(
f'For compatibility "{request_value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
r = edit_version.json()
> assert (
edit_version.status_code == 200
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:762: AssertionError
------------------------------Captured stdout call------------------------------
<Response [200]> <Response [403]> For compatibility "['firefox']": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_valid_compatibility_values[Valid app - firefox and valid appversion] 0.90
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', request_value = {'firefox': {'min': '65.0'}}, response_value = {'firefox': {'max': '*', 'min': '65.0'}}

@pytest.mark.parametrize(
"request_value, response_value",
[
(
["android", "firefox"],
{
"android": {"min": "120.0", "max": "*"},
"firefox": {"min": "58.0", "max": "*"},
},
),
(["firefox"], {"firefox": {"min": "58.0", "max": "*"}}),
({"firefox": {"min": "65.0"}}, {"firefox": {"min": "65.0", "max": "*"}})
],
ids=[
"Compatibility in list format, valid apps (firefox and android)",
"Compatibility in list format, only firefox compatibility",
"Valid app - firefox and valid appversion"
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_valid_compatibility_values(
base_url, session_auth, request_value, response_value
):
"""Tests the compatibility field with a set of valid values"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
print(request)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": request_value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(edit_version)
print(
f'For compatibility "{request_value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
r = edit_version.json()
> assert (
edit_version.status_code == 200
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:762: AssertionError
------------------------------Captured stdout call------------------------------
<Response [200]> <Response [403]> For compatibility "{'firefox': {'min': '65.0'}}": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_values[None/No values] 0.85
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = [None, None]

@pytest.mark.parametrize(
"value",
[
[None, None],
["firefox", None],
{"firefox": {"min": "*"}},
{"firefox": {"min": "78.*"}},
{"android": {"max": "99595.0"}},
{"firefox": {"min": "*", "max": "65.0"}},
],
ids=[
"None/No values",
"Valid app for firefox, None for android",
'Invalid firefox min appversion - "*"',
'Invalid firefox min appversion - "x.*"',
"Unavailable max appversion",
"Valid max version, invalid min version",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_values(base_url, session_auth, value):
"""Compatibility values should be a combination of valid applications (firefox or android)
and application versions (existing versions of Firefox for desktop/android)"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:813: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "[None, None]": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_values[Valid app for firefox, None for android] 0.82
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = ['firefox', None]

@pytest.mark.parametrize(
"value",
[
[None, None],
["firefox", None],
{"firefox": {"min": "*"}},
{"firefox": {"min": "78.*"}},
{"android": {"max": "99595.0"}},
{"firefox": {"min": "*", "max": "65.0"}},
],
ids=[
"None/No values",
"Valid app for firefox, None for android",
'Invalid firefox min appversion - "*"',
'Invalid firefox min appversion - "x.*"',
"Unavailable max appversion",
"Valid max version, invalid min version",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_values(base_url, session_auth, value):
"""Compatibility values should be a combination of valid applications (firefox or android)
and application versions (existing versions of Firefox for desktop/android)"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:813: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "['firefox', None]": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_values[Invalid firefox min appversion - "*"] 0.83
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = {'firefox': {'min': '*'}}

@pytest.mark.parametrize(
"value",
[
[None, None],
["firefox", None],
{"firefox": {"min": "*"}},
{"firefox": {"min": "78.*"}},
{"android": {"max": "99595.0"}},
{"firefox": {"min": "*", "max": "65.0"}},
],
ids=[
"None/No values",
"Valid app for firefox, None for android",
'Invalid firefox min appversion - "*"',
'Invalid firefox min appversion - "x.*"',
"Unavailable max appversion",
"Valid max version, invalid min version",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_values(base_url, session_auth, value):
"""Compatibility values should be a combination of valid applications (firefox or android)
and application versions (existing versions of Firefox for desktop/android)"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:813: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "{'firefox': {'min': '*'}}": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_values[Invalid firefox min appversion - "x.*"] 0.88
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = {'firefox': {'min': '78.*'}}

@pytest.mark.parametrize(
"value",
[
[None, None],
["firefox", None],
{"firefox": {"min": "*"}},
{"firefox": {"min": "78.*"}},
{"android": {"max": "99595.0"}},
{"firefox": {"min": "*", "max": "65.0"}},
],
ids=[
"None/No values",
"Valid app for firefox, None for android",
'Invalid firefox min appversion - "*"',
'Invalid firefox min appversion - "x.*"',
"Unavailable max appversion",
"Valid max version, invalid min version",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_values(base_url, session_auth, value):
"""Compatibility values should be a combination of valid applications (firefox or android)
and application versions (existing versions of Firefox for desktop/android)"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:813: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "{'firefox': {'min': '78.*'}}": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_values[Unavailable max appversion] 0.89
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = {'android': {'max': '99595.0'}}

@pytest.mark.parametrize(
"value",
[
[None, None],
["firefox", None],
{"firefox": {"min": "*"}},
{"firefox": {"min": "78.*"}},
{"android": {"max": "99595.0"}},
{"firefox": {"min": "*", "max": "65.0"}},
],
ids=[
"None/No values",
"Valid app for firefox, None for android",
'Invalid firefox min appversion - "*"',
'Invalid firefox min appversion - "x.*"',
"Unavailable max appversion",
"Valid max version, invalid min version",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_values(base_url, session_auth, value):
"""Compatibility values should be a combination of valid applications (firefox or android)
and application versions (existing versions of Firefox for desktop/android)"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:813: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "{'android': {'max': '99595.0'}}": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_invalid_compatibility_values[Valid max version, invalid min version] 1.01
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', value = {'firefox': {'max': '65.0', 'min': '*'}}

@pytest.mark.parametrize(
"value",
[
[None, None],
["firefox", None],
{"firefox": {"min": "*"}},
{"firefox": {"min": "78.*"}},
{"android": {"max": "99595.0"}},
{"firefox": {"min": "*", "max": "65.0"}},
],
ids=[
"None/No values",
"Valid app for firefox, None for android",
'Invalid firefox min appversion - "*"',
'Invalid firefox min appversion - "x.*"',
"Unavailable max appversion",
"Valid max version, invalid min version",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_invalid_compatibility_values(base_url, session_auth, value):
"""Compatibility values should be a combination of valid applications (firefox or android)
and application versions (existing versions of Firefox for desktop/android)"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {**payloads.edit_version_details, "compatibility": value}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
print(
f'For compatibility "{value}": Response status is '
f"{edit_version.status_code}; {edit_version.text}\n"
)
> assert (
edit_version.status_code == 400
), f"Actual status code was {edit_version.status_code}"
E AssertionError: Actual status code was 403
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:813: AssertionError
------------------------------Captured stdout call------------------------------
For compatibility "{'firefox': {'min': '*', 'max': '65.0'}}": Response status is 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
Failed tests/api/test_api_versions_edit.py::test_edit_version_disable_current_version 0.88
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'

@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_edit_version_disable_current_version(base_url, session_auth):
"""Disable then re-enable the current version of an addon as a developer"""
addon = payloads.edit_addon_details["slug"]
request = requests.get(
url=f"{base_url}{_addon_create}{addon}",
headers={"Authorization": f"Session {session_auth}"},
)
# get the version id of the version we want to edit
version = request.json()["current_version"]["id"]
payload = {"is_disabled": True}
edit_version = requests.patch(
url=f"{base_url}{_addon_create}{addon}/versions/{version}/",
headers={
"Authorization": f"Session {session_auth}",
"Content-Type": "application/json",
},
data=json.dumps(payload),
)
> assert (
edit_version.status_code == 200
), f"Actual response was: {edit_version.status_code}; {edit_version.text}"
E AssertionError: Actual response was: 403; {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 200
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:851: AssertionError
Failed tests/api/test_api_versions_edit.py::test_delete_extension_with_invalid_tokens[Random string] 0.32
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', token = 'random-string'

@pytest.mark.parametrize(
"token",
[
"random-string",
"",
123,
None,
],
ids=[
"Random string",
"Empty string",
"Integer",
"None/No value",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_delete_extension_with_invalid_tokens(base_url, session_auth, token):
"""Use invalid formats or data types for the token required to delete an addon"""
addon = payloads.edit_addon_details["slug"]
delete_addon = requests.delete(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
params={"delete_confirm": token},
)
> assert (
delete_addon.status_code == 400
), f'For token "{token}", status code = {delete_addon.status_code}, message = {delete_addon.text}'
E AssertionError: For token "random-string", status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:948: AssertionError
Failed tests/api/test_api_versions_edit.py::test_delete_extension_with_invalid_tokens[Integer] 0.33
base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo', token = 123

@pytest.mark.parametrize(
"token",
[
"random-string",
"",
123,
None,
],
ids=[
"Random string",
"Empty string",
"Integer",
"None/No value",
],
)
@pytest.mark.serial
@pytest.mark.create_session("api_user")
def test_delete_extension_with_invalid_tokens(base_url, session_auth, token):
"""Use invalid formats or data types for the token required to delete an addon"""
addon = payloads.edit_addon_details["slug"]
delete_addon = requests.delete(
url=f"{base_url}{_addon_create}{addon}/",
headers={"Authorization": f"Session {session_auth}"},
params={"delete_confirm": token},
)
> assert (
delete_addon.status_code == 400
), f'For token "{token}", status code = {delete_addon.status_code}, message = {delete_addon.text}'
E AssertionError: For token "123", status code = 403, message = {"detail":"You do not have permission to perform this action.","is_disabled_by_developer":false,"is_disabled_by_mozilla":false}
E assert 403 == 400
E + where 403 = <Response [403]>.status_code

tests/api/test_api_versions_edit.py:948: AssertionError
Failed tests/api/test_api_versions_edit.py::test_delete_extension_valid_token[Desktop] 6.87
selenium = <selenium.webdriver.firefox.webdriver.WebDriver (session="bc53aecb-9a6f-49c1-bf16-621af2f5b388")>, base_url = 'https://addons.allizom.org', session_auth = 'mbzod2nbhdk4afkhmxtwqsrcc6dju2wo'
variables = {'4mb_addon_slug': '4mb_addon_slug', 'addon_detail_guid': '{446900e4-71c2-419f-a6a7-df9c091e268b}', 'addon_detail_id':...dd-ons must comply with Mozilla’s Add-on Policies and are subject to manual review at any time after submission.', ...}

@pytest.mark.serial
@pytest.mark.create_session("api_user")
@pytest.mark.clear_session
def test_delete_extension_valid_token(selenium, base_url, session_auth, variables):
addon = payloads.edit_addon_details["slug"]
get_delete_confirm = requests.get(
url=f"{base_url}{_addon_create}{addon}/delete_confirm/",
headers={"Authorization": f"Session {session_auth}"},
)
> get_delete_confirm.raise_for_status()

tests/api/test_api_versions_edit.py:970:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <Response [403]>

def raise_for_status(self):
"""Raises :class:`HTTPError`, if one occurred."""

http_error_msg = ""
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode("utf-8")
except UnicodeDecodeError:
reason = self.reason.decode("iso-8859-1")
else:
reason = self.reason

if 400 <= self.status_code < 500:
http_error_msg = (
f"{self.status_code} Client Error: {reason} for url: {self.url}"
)

elif 500 <= self.status_code < 600:
http_error_msg = (
f"{self.status_code} Server Error: {reason} for url: {self.url}"
)

if http_error_msg:
> raise HTTPError(http_error_msg, response=self)
E requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://addons.allizom.org/api/v5/addons/addon/new_sluggish_slug/delete_confirm/

venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError
Skipped tests/api/test_addon_abuse_report.py::test_abuse_report_unauthenticated_post[Desktop] 0.00
('/Users/alexandru.schek/addons-release-tests/tests/api/test_addon_abuse_report.py', 12, 'Skipped: Skipped for the moment due to throttle in place, to be removed with next pr')
Skipped tests/api/test_addon_uploads.py::test_upload_addon_restricted_user[Desktop] 0.00
('/Users/alexandru.schek/addons-release-tests/tests/api/test_addon_uploads.py', 1347, 'Skipped: skip, need to update the user')
Passed tests/api/test_addon_abuse_report.py::test_abuse_report_authenticated[Desktop] 82.21
-----------------------------Captured stdout setup------------------------------
The "click continue button" event occurred.
Passed tests/api/test_addon_abuse_report.py::test_abuse_report_minimal_details[Desktop] 5.77
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_addon_install_method_parameter[Desktop-Accepted value: link] 5.73
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_addon_install_method_parameter[Desktop-Unsupported value: random_text] 6.54
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_addon_install_source_parameter[Desktop-Accepted value: amo] 5.47
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_addon_install_source_parameter[Desktop-Unsupported value: random_text] 5.71
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_reason_parameter[Desktop-Accepted value: damage] 5.45
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_reason_parameter[Desktop-Unsupported value: random_text] 5.72
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_addon_signature_parameter[Desktop-Accepted value: curated_and_partner] 5.41
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_addon_signature_parameter[Desktop-Unsupported value: random_text] 5.60
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_report_entry_point_parameter[Desktop-Accepted value: unified_context_menu] 5.36
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_report_entry_point_parameter[Desktop-Unsupported value: random_text] 5.63
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_location_parameter[Desktop-Accepted value: both] 5.76
No log output captured.
Passed tests/api/test_addon_abuse_report.py::test_location_parameter[Desktop-Unsupported value: random_text] 5.63
No log output captured.
Passed tests/api/test_addon_uploads.py::test_unauthenticated_addon_upload 0.28
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_addon_without_dev_agreement[Desktop] 13.97
------------------------------Captured stdout call------------------------------
The "click continue button" event occurred.
Passed tests/api/test_addon_uploads.py::test_bad_authentication_addon_upload[Desktop] 46.39
-----------------------------Captured stdout setup------------------------------
The "click continue button" event occurred.
------------------------------Captured stdout call------------------------------
Session Token: None Uploading to: https://addons.allizom.org/api/v5/addons/upload/
Passed tests/api/test_addon_uploads.py::test_upload_addon_crx_archive 12.66
------------------------------Captured stdout call------------------------------
Session Token: jn6ex21smu7pmfq0r7euvd6u98a1q4kv Uploading to: https://addons.allizom.org/api/v5/addons/upload/
Passed tests/api/test_addon_uploads.py::test_upload_addon_unsupported_file_types[Archive in "7z" format] 8.49
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_addon_unsupported_file_types[Archive in "tgz" format] 8.38
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_addon_unsupported_file_types[Archive in "tar.gz" format] 8.42
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_addon_unsupported_file_types[Non archive - JSON file] 8.29
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_addon_with_broken_archives[A "tar" compression renamed as "zip"] 8.40
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_addon_with_broken_archives[Corrupt archive] 8.35
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_unlisted_extension 9.21
------------------------------Captured stdout call------------------------------
{ "uuid": "bc9c214509614d37942d90160068d933", "channel": "unlisted", "processed": false, "submitted": false, "url": "https://addons.allizom.org/api/v5/addons/upload/bc9c214509614d37942d90160068d933/", "valid": false, "validation": null, "version": "1.0" } { "id": 2245924, "authors": [ { "id": 11688807, "name": "api_user", "url": "https://addons.allizom.org/en-US/firefox/user/11688807/", "username": "anonymous-c2f376812af322105f986b81fcbb5113", "picture_url": null } ], "average_daily_users": 0, "categories": [], "contributions_url": "", "created": "2025-03-12T12:27:58Z", "current_version": null, "default_locale": "en-US", "description": null, "developer_comments": null, "edit_url": "https://addons.allizom.org/en-US/developers/addon/5c4b2a5be0f04e8c82f1/edit", "guid": "{fbcbc780-75b5-4b06-8c87-690c1751ca43}", "has_eula": false, "has_privacy_policy": false, "homepage": null, "icon_url": "https://addons.allizom.org/static-server/img/addon-icons/default-64.d144b50f2bb8.png", "icons": { "32": "https://addons.allizom.org/static-server/img/addon-icons/default-32.2b26add4b394.png", "64": "https://addons.allizom.org/static-server/img/addon-icons/default-64.d144b50f2bb8.png", "128": "https://addons.allizom.org/static-server/img/addon-icons/default-128.452018499894.png" }, "is_disabled": false, "is_experimental": false, "last_updated": null, "name": { "en-US": "Unlisted-addon-auto" }, "previews": [], "promoted": null, "ratings": { "average": 0.0, "bayesian_average": 0.0, "count": 0, "text_count": 0 }, "ratings_url": "https://addons.allizom.org/en-US/firefox/addon/5c4b2a5be0f04e8c82f1/reviews/", "requires_payment": false, "review_url": "https://addons.allizom.org/en-US/reviewers/review/2245924", "slug": "5c4b2a5be0f04e8c82f1", "status": "incomplete", "summary": { "en-US": "A test extension from webext-generator." }, "support_email": null, "support_url": null, "tags": [], "type": "extension", "url": "https://addons.allizom.org/en-US/firefox/addon/5c4b2a5be0f04e8c82f1/", "version": { "id": 3732402, "approval_notes": "", "channel": "unlisted", "compatibility": { "firefox": { "min": "58.0", "max": "*" } }, "edit_url": "https://addons.allizom.org/en-US/developers/addon/5c4b2a5be0f04e8c82f1/versions/3732402", "file": { "id": 2350770, "created": "2025-03-12T12:27:59Z", "hash": "sha256:cdd76eafbc6c9465e0b6399fa712edc4b0c9e2a994947d52f1872b6fa41af462", "is_mozilla_signed_extension": false, "size": 233, "status": "unreviewed", "url": "https://addons.allizom.org/firefox/downloads/file/2350770/5c4b2a5be0f04e8c82f1-1.0.zip", "permissions": [], "optional_permissions": [], "host_permissions": [] }, "is_disabled": false, "is_strict_compatibility_enabled": false, "license": null, "release_notes": null, "reviewed": null, "source": null, "version": "1.0" }, "versions_url": "https://addons.allizom.org/en-US/firefox/addon/5c4b2a5be0f04e8c82f1/versions/", "weekly_downloads": 0, "latest_unlisted_version": { "id": 3732402, "approval_notes": "", "compatibility": { "firefox": { "min": "58.0", "max": "*" } }, "edit_url": "https://addons.allizom.org/en-US/developers/addon/5c4b2a5be0f04e8c82f1/versions/3732402", "file": { "id": 2350770, "created": "2025-03-12T12:27:59Z", "hash": "sha256:cdd76eafbc6c9465e0b6399fa712edc4b0c9e2a994947d52f1872b6fa41af462", "is_mozilla_signed_extension": false, "size": 233, "status": "unreviewed", "url": "https://addons.allizom.org/firefox/downloads/file/2350770/5c4b2a5be0f04e8c82f1-1.0.zip", "permissions": [], "optional_permissions": [], "host_permissions": [] }, "is_disabled": false, "is_strict_compatibility_enabled": false, "license": null, "release_notes": null, "reviewed": null, "version": "1.0", "source": null } }
Passed tests/api/test_addon_uploads.py::test_submit_extension_with_invalid_uuid_format 3.68
------------------------------Captured stdout call------------------------------
For UUID "some-invalid-uuid": Response status is 400; {"version":{"upload":["“some-invalid-uuid” is not a valid UUID."]}} For UUID "{'upload': 'd4ce752a971b4a5aafcd175122726431'}": Response status is 400; {"version":{"upload":["“{'upload': 'd4ce752a971b4a5aafcd175122726431'}” is not a valid UUID."]}} For UUID "None": Response status is 400; {"version":{"upload":["This field may not be null."]}} For UUID "": Response status is 400; {"version":{"upload":["This field may not be null."]}}
Passed tests/api/test_addon_uploads.py::test_submit_extension_with_incorrect_uuid 1.74
------------------------------Captured stdout call------------------------------
For UUID "d4ce752a971b4a5aafcd175122726431": Response status is 400; {"version":{"upload":["Object with uuid=d4ce752a971b4a5aafcd175122726431 does not exist."]}} For UUID "12345": Response status is 400; {"version":{"upload":["Object with uuid=12345 does not exist."]}}
Passed tests/api/test_addon_uploads.py::test_submit_xpi_with_trademark_restricted_user[Firefox in addon name] 7.05
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Firefox in addon name'}
Passed tests/api/test_addon_uploads.py::test_submit_xpi_with_trademark_restricted_user[Mozilla in addon name] 6.76
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Mozilla in addon name'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@mozilla.com] 6.85
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@mozilla.com'}}} {'uuid': '132a49ce52964bfb965d570a55e5e329', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/132a49ce52964bfb965d570a55e5e329/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@pioneer.mozilla.org] 6.75
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@pioneer.mozilla.org'}}} {'uuid': '591c1675325240fe82399b25d8c0aac7', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/591c1675325240fe82399b25d8c0aac7/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@search.mozilla.org] 6.90
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@search.mozilla.org'}}} {'uuid': 'ad2ee52e199540338bf4f707f67bc55b', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/ad2ee52e199540338bf4f707f67bc55b/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@shield.mozilla.com] 6.96
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@shield.mozilla.com'}}} {'uuid': '3a8cfb60f9e6401e938789b7e5f193d3', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/3a8cfb60f9e6401e938789b7e5f193d3/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@shield.mozilla.org] 6.80
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@shield.mozilla.org'}}} {'uuid': 'ebc6d9b2e4c04cb7976510151619d88e', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/ebc6d9b2e4c04cb7976510151619d88e/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@mozillaonline.com] 6.81
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@mozillaonline.com'}}} {'uuid': 'a9b6fae9d3b845ed80f4e09f7e66551a', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/a9b6fae9d3b845ed80f4e09f7e66551a/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@mozillafoundation.org] 6.79
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@mozillafoundation.org'}}} {'uuid': '7e941d4f9c474e1f9f2ead45881e6d33', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/7e941d4f9c474e1f9f2ead45881e6d33/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@rally.mozilla.org] 6.82
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@rally.mozilla.org'}}} {'uuid': '05fcc1de0fe048faa083b3b3475b2200', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/05fcc1de0fe048faa083b3b3475b2200/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@temporary-addon] 6.86
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@temporary-addon'}}} {'uuid': '6b9ceae0852a42c993daa76f76bb8a2b', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/6b9ceae0852a42c993daa76f76bb8a2b/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_submit_addon_with_reserved_guid[reserved_guid@mozac.org] 6.85
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reserved guid', 'browser_specific_settings': {'gecko': {'id': 'reserved_guid@mozac.org'}}} {'uuid': '767d8fd678484d6ca8296c37edeb6129', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/767d8fd678484d6ca8296c37edeb6129/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_duplicate_guid 6.87
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Duplicate guid', 'browser_specific_settings': {'gecko': {'id': '@contain-facebook'}}}
Passed tests/api/test_addon_uploads.py::test_upload_extension_without_name_in_manifest 8.37
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0'} {'uuid': '29035eb11cef403e9c3a5691312ed34f', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/29035eb11cef403e9c3a5691312ed34f/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_upload_extension_without_summary 6.86
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Addon without Summary'} {'uuid': '22fb036f0be74039a130b44606954780', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/22fb036f0be74039a130b44606954780/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_incorrect_version_number 8.19
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1abc.1.1a#c', 'name': 'Addon with invalid version'}
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_put_method 8.59
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'PUT-create-addon-neqwha-Mar #d, 2025', 'browser_specific_settings': {'gecko': {'id': 'random-guid@sryfoe'}}} {'uuid': '09c37256089243c8b38bc05a75e5e492', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/09c37256089243c8b38bc05a75e5e492/', 'valid': False, 'validation': None, 'version': '1.0'} { "id": 2245925, "authors": [ { "id": 11688807, "name": "api_user", "url": "https://addons.allizom.org/en-US/firefox/user/11688807/", "username": "anonymous-c2f376812af322105f986b81fcbb5113", "picture_url": null } ], "average_daily_users": 0, "categories": [ "appearance", "download-management" ], "contributions_url": "", "created": "2025-03-12T12:30:12Z", "current_version": { "id": 3732403, "approval_notes": "", "compatibility": { "firefox": { "min": "58.0", "max": "*" }, "android": { "min": "120.0", "max": "*" } }, "edit_url": "https://addons.allizom.org/en-US/developers/addon/put-create-addon-neqwha-mar-d-/versions/3732403", "file": { "id": 2350771, "created": "2025-03-12T12:30:13Z", "hash": "sha256:f73eee2dfcc560fe18c2f908663d13709b0c156e26b1ffcae03402f4685cc188", "is_mozilla_signed_extension": false, "size": 269, "status": "unreviewed", "url": "https://addons.allizom.org/firefox/downloads/file/2350771/put_create_addon_neqwha_mar_d-1.0.zip", "permissions": [], "optional_permissions": [], "host_permissions": [] }, "is_disabled": false, "is_strict_compatibility_enabled": false, "license": { "id": 5045, "is_custom": false, "name": { "en-US": "All Rights Reserved" }, "slug": "all-rights-reserved", "url": null }, "release_notes": null, "reviewed": null, "version": "1.0", "source": null }, "default_locale": "en-US", "description": null, "developer_comments": null, "edit_url": "https://addons.allizom.org/en-US/developers/addon/put-create-addon-neqwha-mar-d-/edit", "guid": "random-guid@sryfoe", "has_eula": false, "has_privacy_policy": false, "homepage": null, "icon_url": "https://addons.allizom.org/static-server/img/addon-icons/default-64.d144b50f2bb8.png", "icons": { "32": "https://addons.allizom.org/static-server/img/addon-icons/default-32.2b26add4b394.png", "64": "https://addons.allizom.org/static-server/img/addon-icons/default-64.d144b50f2bb8.png", "128": "https://addons.allizom.org/static-server/img/addon-icons/default-128.452018499894.png" }, "is_disabled": false, "is_experimental": false, "last_updated": null, "name": { "en-US": "PUT-create-addon-neqwha-Mar #d, 2025" }, "previews": [], "promoted": null, "ratings": { "average": 0.0, "bayesian_average": 0.0, "count": 0, "text_count": 0 }, "ratings_url": "https://addons.allizom.org/en-US/firefox/addon/put-create-addon-neqwha-mar-d-/reviews/", "requires_payment": false, "review_url": "https://addons.allizom.org/en-US/reviewers/review/2245925", "slug": "put-create-addon-neqwha-mar-d-", "status": "nominated", "summary": { "en-US": "Addon summary" }, "support_email": null, "support_url": null, "tags": [], "type": "extension", "url": "https://addons.allizom.org/en-US/firefox/addon/put-create-addon-neqwha-mar-d-/", "version": { "id": 3732403, "approval_notes": "", "channel": "listed", "compatibility": { "firefox": { "min": "58.0", "max": "*" }, "android": { "min": "120.0", "max": "*" } }, "edit_url": "https://addons.allizom.org/en-US/developers/addon/put-create-addon-neqwha-mar-d-/versions/3732403", "file": { "id": 2350771, "created": "2025-03-12T12:30:13Z", "hash": "sha256:f73eee2dfcc560fe18c2f908663d13709b0c156e26b1ffcae03402f4685cc188", "is_mozilla_signed_extension": false, "size": 269, "status": "unreviewed", "url": "https://addons.allizom.org/firefox/downloads/file/2350771/put_create_addon_neqwha_mar_d-1.0.zip", "permissions": [], "optional_permissions": [], "host_permissions": [] }, "is_disabled": false, "is_strict_compatibility_enabled": false, "license": { "id": 5045, "is_custom": false, "name": { "en-US": "All Rights Reserved" }, "slug": "all-rights-reserved", "text": null, "url": null }, "release_notes": null, "reviewed": null, "source": null, "version": "1.0" }, "versions_url": "https://addons.allizom.org/en-US/firefox/addon/put-create-addon-neqwha-mar-d-/versions/", "weekly_downloads": 0, "latest_unlisted_version": null }
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_put_guid_mismatch 6.85
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'PUT-guid-mismatch', 'browser_specific_settings': {'gecko': {'id': 'random-guid@llzqss'}}} {'uuid': '14c19181e3aa48ba8e48f5c097e5ba5f', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/14c19181e3aa48ba8e48f5c097e5ba5f/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_put_no_guid_in_manifest 6.86
------------------------------Captured stdout call------------------------------
{'uuid': '15f86270a9f0443dbed5cb8b9b7e3637', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/15f86270a9f0443dbed5cb8b9b7e3637/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_put_no_guid_in_request 6.22
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'PUT-no-guid-in-request-url', 'browser_specific_settings': {'gecko': {'id': 'random-guid@uyuncs'}}}
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_put_invalid_guid_format 8.40
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Invalid guid format', 'browser_specific_settings': {'gecko': {'id': 'invalid-ujtrek'}}} {'uuid': '5481d608f53745dcb337bfe783c53401', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/5481d608f53745dcb337bfe783c53401/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_addon_uploads.py::test_upload_extension_default_locale_has_no_translations 6.96
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_extension_with_localizations_in_xpi 8.39
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_localized_extension_json_overwrite 8.54
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_addon_with_guid_from_deleted_addon 16.02
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Reuse GUID of deleted addon', 'browser_specific_settings': {'gecko': {'id': 'reused-guid@pdmwyi'}}}
Passed tests/api/test_addon_uploads.py::test_upload_theme 8.29
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_language_pack_unauthorized_user[Desktop] 52.93
------------------------------Captured stdout call------------------------------
The "click continue button" event occurred.
Passed tests/api/test_addon_uploads.py::test_upload_language_pack_with_authorized_user 9.15
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_language_pack_incorrect_category 7.53
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_privileged_addon_with_unauthorized_account 6.80
No log output captured.
Passed tests/api/test_addon_uploads.py::test_upload_privileged_addon_with_authorized_account[Desktop] 54.59
-----------------------------Captured stdout setup------------------------------
The "click continue button" event occurred.
Passed tests/api/test_addon_uploads.py::test_upload_addon_with_trademark_name_authorized_account[Desktop] 13.04
------------------------------Captured stdout call------------------------------
Manifest content: {'manifest_version': 2, 'version': '1.0', 'name': 'Firefox trademark'}
Passed tests/api/test_api_addons_edit.py::test_extension_add_invalid_categories 6.55
------------------------------Captured stdout call------------------------------
{'uuid': '7c897e8df0ea4bcf9f33ed1ad94948b4', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/7c897e8df0ea4bcf9f33ed1ad94948b4/', 'valid': False, 'validation': None, 'version': '1.0'} For android category "": Response status is 400; {"categories":["Invalid category name."]} For android category "123": Response status is 400; {"categories":["Invalid category name."]} For android category "None": Response status is 400; {"categories":["Invalid category name."]}
Passed tests/api/test_api_addons_edit.py::test_extension_one_category_and_other_category 4.74
------------------------------Captured stdout call------------------------------
{'uuid': '5e5ca75700f54d19a476d53ed79bfccd', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/5e5ca75700f54d19a476d53ed79bfccd/', 'valid': False, 'validation': None, 'version': '1.0'} For android category "Appearance": Response status is 400; {"categories":["Invalid category name."]}
Passed tests/api/test_api_addons_edit.py::test_extension_add_invalid_firefox_categories 7.47
------------------------------Captured stdout call------------------------------
{'uuid': '6f6b66b457de48b89234dc0d0ac824c2', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/6f6b66b457de48b89234dc0d0ac824c2/', 'valid': False, 'validation': None, 'version': '1.0'} For firefox category "fashion": Response status is 400; {"categories":["Invalid category name."]} For firefox category "security-privacy": Response status is 400; {"categories":["Invalid category name."]} For firefox category "": Response status is 400; {"categories":["Invalid category name."]} For firefox category "12.3": Response status is 400; {"categories":["Invalid category name."]}
Passed tests/api/test_api_addons_edit.py::test_extension_other_category_is_standalone 4.84
------------------------------Captured stdout call------------------------------
{'uuid': '370b396b0bee4641a5592a87f9c75c32', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/370b396b0bee4641a5592a87f9c75c32/', 'valid': False, 'validation': None, 'version': '1.0'}
Passed tests/api/test_api_addons_edit.py::test_extension_invalid_slug 8.43
------------------------------Captured stdout call------------------------------
{'uuid': '9419476201c2415a9e8e3cbb7abbfcde', 'channel': 'listed', 'processed': False, 'submitted': False, 'url': 'https://addons.allizom.org/api/v5/addons/upload/9419476201c2415a9e8e3cbb7abbfcde/', 'valid': False, 'validation': None, 'version': '1.0'} For slug "102030": Response status is 400; {"slug":["This slug cannot be used. Please choose another."],"version":{"upload":["Upload is not valid."]}} For slug "---": Response status is 400; {"slug":["Enter a valid “slug” consisting of letters, numbers, underscores or hyphens."]} For slug "?name": Response status is 400; {"slug":["Enter a valid “slug” consisting of letters, numbers, underscores or hyphens."]} For slug "@#_)(": Response status is 400; {"slug":["Enter a valid “slug” consisting of letters, numbers, underscores or hyphens."]} For slug "None": Response status is 400; {"slug":["Enter a valid “slug” consisting of letters, numbers, underscores or hyphens."]}
Passed tests/api/test_api_addons_edit.py::test_edit_extension_previews_add_caption 0.40
No log output captured.
Passed tests/api/test_api_addons_edit.py::test_edit_extension_delete_previews 0.73
No log output captured.
Passed tests/api/test_api_addons_edit.py::test_edit_addon_with_incorrect_account[Desktop] 48.27
------------------------------Captured stdout call------------------------------
The "click continue button" event occurred.
Passed tests/api/test_api_authors_edit.py::test_addon_author_confirm_deleted_invitation 0.32
No log output captured.
Passed tests/api/test_api_authors_edit.py::test_addon_developer_role_cannot_add_authors 0.31
No log output captured.
Passed tests/api/test_api_authors_edit.py::test_addon_developer_role_cannot_edit_pending_author 0.32
No log output captured.
Passed tests/api/test_api_authors_edit.py::test_addon_developer_role_cannot_delete_pending_author 0.31
No log output captured.
Passed tests/api/test_api_authors_edit.py::test_unauthorized_user_change_author_details 0.30
No log output captured.
Passed tests/api/test_api_authors_edit.py::test_addon_developer_role_cannot_edit_authors 0.31
No log output captured.
Passed tests/api/test_api_authors_edit.py::test_addon_developer_role_cannot_delete_authors 0.30
No log output captured.
Passed tests/api/test_api_authors_edit.py::test_addon_developer_role_cannot_delete_addon 0.35
No log output captured.
Passed tests/api/test_api_versions_edit.py::test_sources_cannot_be_changed_for_approved_versions 1.51
No log output captured.
Passed tests/api/test_api_versions_edit.py::test_delete_extension_non_existent_addon 0.28
No log output captured.
Passed tests/api/test_api_versions_edit.py::test_delete_extension_from_another_author 0.31
No log output captured.
Passed tests/api/test_api_versions_edit.py::test_delete_extension_with_invalid_tokens[Empty string] 0.29
No log output captured.
Passed tests/api/test_api_versions_edit.py::test_delete_extension_with_invalid_tokens[None/No value] 0.31
No log output captured.